﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Element="clr-namespace:SegmentDisplay.Common.Element;assembly=SegmentDisplay.Common"
                    xmlns:digit07="clr-namespace:SegmentDisplay.Common.Digit07;assembly=SegmentDisplay.Common"
                    xmlns:Date="clr-namespace:SegmentDisplay.Custom.Date"
                    >

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/SegmentDisplay.Common;component/Element/Resources.xaml" />
        <ResourceDictionary Source="pack://application:,,,/SegmentDisplay.Common;component/Digit07/Resources.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--Resource dictionary for Indicator Date control-->

    <!--IndicatorDate-->
    <ControlTemplate x:Key="IndicatorDateTemplate"  TargetType="{x:Type Date:IndicatorDate}">
        <Viewbox Height="{TemplateBinding Height}" >
            <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <!--Days-->
                <digit07:SegmentDigit07 Grid.Column="0" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding D1}"/>
                <digit07:SegmentDigit07 Grid.Column="1" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding D2}"/>

                <!--Delimiter-->
                <Element:SegmentElement Grid.Column="2" Height="{TemplateBinding Height}" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding SeparatorStyle}"
                                 Value="{TemplateBinding Delimiter}"/>

                <!--Month-->
                <digit07:SegmentDigit07 Grid.Column="3" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding M1}"/>
                <digit07:SegmentDigit07 Grid.Column="4" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding M2}"/>

                <!--Delimiter-->
                <Element:SegmentElement Grid.Column="5" Height="{TemplateBinding Height}" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding SeparatorStyle}"
                                 Value="{TemplateBinding Delimiter}"/>

                <!--Years-->
                <digit07:SegmentDigit07 Grid.Column="6" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding Y1}"/>
                <digit07:SegmentDigit07 Grid.Column="7" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding Y2}"/>
                <digit07:SegmentDigit07 Grid.Column="8" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding Y3}"/>
                <digit07:SegmentDigit07 Grid.Column="9" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding Y4}"/>
            </Grid>
        </Viewbox>
    </ControlTemplate>

    <Style x:Key="IndicatorDateStyle" TargetType="{x:Type Date:IndicatorDate}">
        <Setter Property="Template" Value="{StaticResource IndicatorDateTemplate}" />
    </Style>

</ResourceDictionary>